package com.cfp4cloud.cfp.knowledge.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonProperty;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.FieldNameConstants;

import java.time.LocalDateTime;

/**
 * 知识文档
 *
 * @author pig
 * @date 2024-03-14 13:38:59
 */
@Data
@TableName("ai_document")
@FieldNameConstants
@EqualsAndHashCode(callSuper = true)
@Schema(description = "知识文档")
public class AiDocumentEntity extends Model<AiDocumentEntity> {

	/**
	 * 主键
	 */
	@TableId(type = IdType.ASSIGN_ID)
	@Schema(description = "主键")
	private Long id;

	/**
	 * 知识库ID
	 */
	@Schema(description = "知识库ID")
	private Long datasetId;

	/**
	 * 名称
	 */
	@Schema(description = "名称")
	private String name;

	/**
	 * 文件类型
	 */
	@Schema(description = "文件类型")
	private String fileType;

	/**
	 * 文件链接
	 */
	@Schema(description = "文件链接")
	private String fileUrl;

	/**
	 * 文件hash
	 */
	private String fileHash;

	/**
	 * 文件来源
	 */
	@Schema(description = "文件来源")
	private String sourceType;

	/**
	 * 切片数量
	 */
	@Schema(description = "切片数量")
	private Long sliceCount = 0L;

	/**
	 * 命中次数
	 */
	@Schema(description = "命中次数")
	private Long hitCount = 0L;

	/**
	 * 文件大小
	 */
	@Schema(description = "文件大小")
	private Long fileSize;

	/**
	 * 切片状态 0 未切片 1 已切片 9 失败
	 */
	@Schema(description = "切片状态")
	private String sliceStatus;

	/**
	 * 切片失败原因
	 */
	@Schema(description = "失败原因")
	private String sliceFailReason;

	/**
	 * 状态
	 */
	@Schema(description = "状态")
	private String fileStatus;

	/** 图谱状态 */
	@Schema(description = "图谱状态")
	private String graphStatus;

	/**
	 * 文档总结
	 */
	@Schema(description = "文档总结")
	private String summary;

	/**
	 * 总结状态
	 */
	@Schema(description = "状态")
	private String summaryStatus;

	/**
	 * 摘要失败原因
	 */
	@Schema(description = "失败原因")
	private String summaryFailReason;

	/**
	 * 文档配置
	 */
	@JsonProperty(access = JsonProperty.Access.WRITE_ONLY)
	@Schema(description = "文档配置")
	private String documentConfig;

	/**
	 * 创建人
	 */
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "创建人")
	private String createBy;

	/**
	 * 创建时间
	 */
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "创建时间")
	private LocalDateTime createTime;

	/**
	 * 修改人
	 */
	@TableField(fill = FieldFill.INSERT_UPDATE)
	@Schema(description = "修改人")
	private String updateBy;

	/**
	 * 修改时间
	 */
	@TableField(fill = FieldFill.INSERT_UPDATE)
	@Schema(description = "修改时间")
	private LocalDateTime updateTime;

	/**
	 * 删除标记
	 */
	@TableLogic
	@TableField(fill = FieldFill.INSERT)
	@Schema(description = "删除标记")
	private String delFlag;

}
